#include <fstream>
#include <iostream>
using std::cout;
using std::endl;
using std::ofstream;
using std::string;

void test0(){
    string filename = "test1.txt";
    //app模式是能够确保每次寻位到流结尾位置
    ofstream ofs(filename,std::ios::app);

    string line("hello,world\n");
    ofs << line;

    ofs.close();
}

int main(void){
    test0();
    return 0;
}


